Get Function Arity
This feature allows you to get the number of parameters of a function. In the code sample, a function declaration with two parameters ('a' and 'b') is created using Babel types, and the arity of the function is determined using the getFunctionArity utility.
const getFunctionArity = require('babel-helper-get-function-arity');
const t = require('@babel/types');
const func = t.functionDeclaration(
t.identifier('myFunction'),
[t.identifier('a'), t.identifier('b')],
t.blockStatement([])
);
console.log(getFunctionArity(func)); // Output: 2